import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.ArrayList;
import java.util.List;
import javax.rmi.PortableRemoteObject;

/**
 * 
 * @author Bua_Pietro
 *
 */
public class PriceListImpl  extends PortableRemoteObject implements PriceList
{
	private List<PropertyImpl> myPriceList;
	
	/**
	 * 
	 * @throws RemoteException
	 */
	public PriceListImpl() throws RemoteException
	{
		myPriceList = new ArrayList<PropertyImpl>();
	}
	
	/**
	 * 
	 * @param key
	 * @param value
	 * @throws RemoteException 
	 */
	public void addPrice( String key, String value ) throws RemoteException
	{
		PropertyImpl propertyImpl = new PropertyImpl(key, value ) ;
		System.out.println("[PriceListImpl > addPrice]" + propertyImpl );
		myPriceList.add( propertyImpl );
	}
	
	/**
	 * 
	 */
	@Override
	public List<PropertyImpl> getPriceList() throws RemoteException
	{
		System.out.println("[PriceListImpl > getPriceList] - Size: " + myPriceList.size() );
		return myPriceList;
	}
}
